const baseSize = 16;
function setRem() {
  const width =
    document.documentElement.clientWidth <= 1100
      ? 1100
      : document.documentElement.clientWidth;
  const scale = width / 1920;
  if (baseSize * Math.min(scale, 2) < 12) {
    document.documentElement.style.fontSize = 12 + "px";
  } else {
    document.documentElement.style.fontSize = baseSize * Math.min(scale, 2) + "px";
  }
}
setRem();
window.onresize = function () {
  setRem();
};
